package edu.wayne.cs.csc4110.hw6.interfaces.lobby;

import java.util.List;

import edu.wayne.cs.csc4110.hw6.interfaces.message.Message;
import edu.wayne.cs.csc4110.hw6.interfaces.user.User;

/**
 * The Observable Lobby Server in which the framework uses to update the
 * LobbyClients
 * 
 * @author Andrew
 * 
 */
public interface LobbyServer {

	/**
	 * Searches the server for a user
	 * 
	 * @param name
	 *            , the name of the user
	 * @return the User with the specified name
	 */
	public User getUser(String name);

	/**
	 * Access the users that are active in the lobby.
	 * 
	 * @return List of users in the lobby
	 */
	public List<User> getUsers();

	/**
	 * Adds a user to the lobby
	 * 
	 * @param u
	 *            the user to be added to the server
	 * @return All of the users that are active in the server
	 */
	public boolean addUser(User u);

	/**
	 * Removes a user from the server
	 * 
	 * @param u
	 *            the user to be removed from the server
	 * @return TODO
	 */
	public boolean removeUser(User u);



	/**
	 * Adds an observer LobbyClient to be able to receive updates from the
	 * LobbyServer
	 * 
	 * @param c
	 *            the client observer to be added
	 */
	public void addClient(LobbyClient c);

	/**
	 * Deletes an observer client from the set of observers of this server
	 * 
	 * @param c
	 *            - the client observer to be deleted
	 */
	public void deleteClient(LobbyClient c);

	/**
	 * Sends a message to the observers
	 * 
	 * @param msg
	 */
	public void sendMessage(Message msg);

}
